package com.wn.member.controller;

import com.wn.bean.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author yellow Docter
 * @date 2023 -07-17
 * @desc
 */
@RestController
@RequestMapping("user")
@Slf4j
public class UserController {

    @GetMapping("/{id}")
    public User findMemberById(@PathVariable("id") Integer id){

        User user = new User();
        user.setAge(20);
        user.setName("王语嫣");
        return user;
    }

    @PostMapping("/add1")
    public String add1(@RequestBody User user){
        log.info("Member 服务拿到的数据是:{}",user);
        return "add1 success";
    }

    @PostMapping("/add2")
    public String add2(@RequestBody Map map){
        log.info("Member 服务拿到的数据是:{}",map);
        return "add2 success";
    }

}
